package com.ambow.api.model.admin;

import lombok.Getter;
import lombok.Setter;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *@Description:sys_org
 *@author root
 *@version 1.0,
 *@date 2018-07-06 09:52:41
 */
@Getter
@Setter
public class SysOrgVo implements Serializable{

	private static final long serialVersionUID = 1L;

	/**ID*/
	@ApiModelProperty(value="ID")
	private java.lang.Long id;

	/**ORG_CODE*/
	@ApiModelProperty(value="ORG_CODE")
	private java.lang.String orgCode;

	/**ORG_NAME*/
	@ApiModelProperty(value="ORG_NAME")
	private java.lang.String orgName;

	/**ORG_TYPE*/
	@ApiModelProperty(value="ORG_TYPE")
	private java.lang.String orgType;

	/**PARENT_ID*/
	@ApiModelProperty(value="PARENT_ID")
	private java.lang.String parentId;

	/**PARENT_IDS*/
	@ApiModelProperty(value="PARENT_IDS")
	private java.lang.String parentIds;

	/**ORDER_BY*/
	@ApiModelProperty(value="ORDER_BY")
	private java.lang.String orderBy;

	/**VALIDATE_STATE*/
	@ApiModelProperty(value="VALIDATE_STATE")
	private java.lang.String validateState;

	/**ORG_LEVEL*/
	@ApiModelProperty(value="ORG_LEVEL")
	private java.lang.String orgLevel;

	/**CREATE_TIME*/
	@ApiModelProperty(value="CREATE_TIME")
	private java.util.Date createTime;

	/**UUID*/
	@ApiModelProperty(value="UUID")
	private java.lang.String uuid;



	public static List<TreeNodeVo> ToTreeModel(List<SysOrgVo> list)
	{
		List<TreeNodeVo> treelist=new ArrayList<>();
		for (SysOrgVo vo:list) {
			TreeNodeVo treenode=new TreeNodeVo();
			treenode.setId(vo.getId().toString());
			treenode.setName(vo.getOrgName());
			treenode.setParentId(vo.getParentId());
			treenode.setLevel(vo.getOrgLevel());
			treenode.setOrgType(vo.getOrgType());
			treenode.setValidateState(vo.getValidateState());
			treelist.add(treenode);
		}
		return TreeNodeVo.treeBuild(treelist);

	}

}